<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>重置连接（再次连接）</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.pg-connection-busy.html">pg_connection_busy</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.pg-connection-status.html">pg_connection_status</a></div>
 <div class="up"><a href="ref.pgsql.html">PostgreSQL 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.pg-connection-reset" class="refentry">
   <div class="refnamediv">
    <h1 class="refname">pg_connection_reset</h1>
    <p class="verinfo">(PHP 4 &gt;= 4.2.0, PHP 5)</p><p class="refpurpose"><span class="refname">pg_connection_reset</span> &mdash; <span class="dc-title">
     重置连接（再次连接）
    </span></p>

   </div>
 <div class="refsect1 description" id="refsect1-function.pg-connection-reset-description">
  <h3 class="title">说明</h3>
    <div class="methodsynopsis dc-description">
     <span class="type">bool</span> <span class="methodname"><strong>pg_connection_reset</strong></span>
      ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$connection</code></span>
     )</div>

    <p class="para rdfs-comment">
     <span class="function"><strong>pg_connection_reset()</strong></span> 重置一个连接，用于错误恢复。
    </p>
 </div>

 
 <div class="refsect1 parameters" id="refsect1-function.pg-connection-reset-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">connection</code></em></dt>

     <dd>

      <p class="para">
       PostgreSQL database connection resource.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.pg-connection-reset-returnvalues">
  <h3 class="title">返回值</h3>
   <p class="para">
    成功时返回 <strong><code>TRUE</code></strong>， 或者在失败时返回 <strong><code>FALSE</code></strong>。
   </p>
 </div>

 
 <div class="refsect1 examples" id="refsect1-function.pg-connection-reset-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-2018">
    <p><strong>Example #1 <span class="function"><strong>pg_connection_reset()</strong></span> 例子</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />&nbsp;&nbsp;$dbconn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">pg_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">"dbname=publisher"</span><span style="color: #007700">)&nbsp;or&nbsp;die(</span><span style="color: #DD0000">"Could&nbsp;not&nbsp;connect"</span><span style="color: #007700">);<br />&nbsp;&nbsp;</span><span style="color: #0000BB">$dbconn2&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">pg_connection_reset</span><span style="color: #007700">(</span><span style="color: #0000BB">$dbconn</span><span style="color: #007700">);<br />&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">$dbconn2</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"reset&nbsp;successful\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"reset&nbsp;failed\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.pg-connection-reset-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.pg-connect.html" class="function" rel="rdfs-seeAlso">pg_connect()</a> - 打开一个 PostgreSQL 连接</span></li>
    <li class="member"><span class="function"><a href="function.pg-pconnect.html" class="function" rel="rdfs-seeAlso">pg_pconnect()</a> - 打开一个持久的 PostgreSQL 连接</span></li>
    <li class="member"><span class="function"><a href="function.pg-connection-status.html" class="function" rel="rdfs-seeAlso">pg_connection_status()</a> - 获得连接状态</span></li>
   </ul>
  </p>
 </div>

  </div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.pg-connection-busy.html">pg_connection_busy</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.pg-connection-status.html">pg_connection_status</a></div>
 <div class="up"><a href="ref.pgsql.html">PostgreSQL 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
